#include <iostream>
using namespace std;
#include <vector>

int main(void)
{
	vector<int> v = {1,2,2,2,5,6,7,8,9,0};

	/*
	for(vector<int>::iterator it = v.begin(); it != v.end();){
		v.erase(it);
	}
	*/

	int delete_value = 0;
	cout << "请输入要删除的数据: ";
	cin >> delete_value;
	for(vector<int>::iterator it = v.begin(); it != v.end();){
		if(*it == delete_value){
			v.erase(it);
		}else{
			it++;
		}
	}

	if(v.empty()){
		cout << "v is empty..." << endl;
	}

	for(vector<int>::iterator it = v.begin(); it != v.end(); it++){
		cout << *it << endl;
	}

	return 0;
}
